#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,k,a[10],flg[10],ans;
const int mod=998244353;
int qpow(int x,int y){
	int now=x,res=1;
	while(y){
		if(y&1) res*=now,res%=mod;
		y>>=1,now*=now,now%=mod;
	}
	return res;
}
void dfs(int u){
	if(u>n){
		memset(flg,0,sizeof(flg));
		for(int i=1;i<=n;i++)
			if(!flg[i]){
				int now=a[i],j=1;
				for(;now!=i&&j<=n;j++)
					now=a[now];
				if(now==i){
					now=a[i];
					while(now!=i) flg[now]=1,now=a[now];
					flg[i]=1;
					ans+=qpow(j,k),ans%=mod;
				}
			}
		return;
	}
	for(int i=1;i<=n;i++){
		a[u]=i;
		dfs(u+1);
	}
}
signed main(){
	freopen("length.in","r",stdin);
	freopen("length.out","w",stdout);
	scanf("%lld%lld",&n,&k);
	dfs(1);
	printf("%lld",ans);
	return 0;
}
